import QtQuick 1.1
import com.nokia.meego 1.0

Item {
    id: listItem
    x: 5
    width: parent.width - 10
    height: listItemContent.implicitHeight

    property bool arrowEnabled: true

    signal itemClicked(variant item)

    BorderImage {
        id: backgroundImage
        anchors.fill: parent
        //anchors.leftMargin: -parent.anchors.leftMargin
        //anchors.rightMargin: -parent.anchors.rightMargin
        visible: mouseArea.pressed
        source: "image://theme/meegotouch-list-background-pressed-center"
    }

    Image {
        id: arrowImage
        visible: arrowEnabled
        source: "image://theme/icon-m-common-drilldown-arrow" + (theme.inverted ? "-inverse" : "")
        anchors { right: parent.right; verticalCenter: parent.verticalCenter }
    }

    MouseArea {
        id: mouseArea
        anchors.fill: backgroundImage
        onClicked: listItem.itemClicked(listItem)
    }
}
